﻿using RPAVIEW.views.controlLibrary;
using System.Windows;
using System.Windows.Controls;
namespace RPAVIEW.views.EditPage.flows.TextCut2ListN {
    /// <summary>
    /// Input.xaml 的交互逻辑
    /// </summary>
    public partial class Input:BaseParamViewAction{
        public Input() {
            InitializeComponent();
        }

        public override void UpdateSource() {
            this.inputText.GetBindingExpression(SelVarTextBox.text).UpdateSource();
            this.customSepString.GetBindingExpression(SelVarTextBox.text).UpdateSource();
            this.separation.GetBindingExpression(ComboBox.SelectedIndexProperty).UpdateSource();
            this.standerSepType.GetBindingExpression(ComboBox.SelectedIndexProperty).UpdateSource();
            this.isRegx.GetBindingExpression(CheckBox.IsCheckedProperty).UpdateSource();
            this.filterEmpty.GetBindingExpression(CheckBox.IsCheckedProperty).UpdateSource();
        }

        private void ChangeView(object sender, SelectionChangedEventArgs e) {
            int index = this.separation.SelectedIndex;
            if(index == 0) {
                this.standerTypeRow.Height = GridLength.Auto;
                this.customRow.Height = new GridLength(0);
                this.isRegxRow.Height = new GridLength(0);
            } else { 
                this.standerTypeRow.Height = new GridLength(0);
                this.customRow.Height = GridLength.Auto;
                this.isRegxRow.Height = GridLength.Auto;
            }
        }
    }
}
